class GlobalManager {
    // 单例
    private static _instance: GlobalManager;
    public static get instance(): GlobalManager {
        if (!GlobalManager._instance) {
            GlobalManager._instance = new GlobalManager();
            GlobalManager._instance.init();
        }
        return GlobalManager._instance;
    }

    private init(): void {
        this._apiServerUrl = GameSettings.defaultUrl;
        this._resUrl = "resource/";
        // this._authToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzE4MTU3NjUsInVpZCI6M30.07pCWtvBGuSTAf6QqHbtsd9IDRMvudjqSPGvctN8_KQ";
        this._authToken = "";
    }

    private _systemInfo: SystemInfo;
    public get systemInfo(): SystemInfo {
        return this._systemInfo;
    }

    public set systemInfo(value: SystemInfo) {
        this._systemInfo = value;
    }

    private _apiServerUrl: string;
    public get apiServerUrl(): string {
        return this._apiServerUrl;
    }
    public set apiServerUrl(url: string) {
        this._apiServerUrl = url;
    }

    private _authToken: string;
    public get authToken(): string {
        return this._authToken;
    }
    public set authToken(token: string) {
        this._authToken = token;
    }

    private _resUrl: string;
    public get resUrl(): string {
        return this._resUrl;
    }
    public set resUrl(url: string) {
        this._resUrl = url;
    }

    private versions: GameVersion = { "game": "1.0.0", "res": "1.0.0", "data": "1.0.0" };

    public get resVersion(): string {
        return this.versions.res;
    }
    public set resVersion(version: string) {
        this.versions.res = version;
    }

    public get dataVersion(): string {
        return this.versions.data;
    }
    public set dataVersion(version: string) {
        this.versions.data = version;
    }

    public get gameVersion(): string {
        return this.versions.game;
    }
    public set gameVersion(version: string) {
        this.versions.game = version;
    }

    private _ip: string;
    public get ip(): string {
        return this._ip;
    }

    public set ip(value: string) {
        this._ip = value;
    }
}